<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<div id="examRecordGrid"></div>
<div id="examRecordToolbar">
	<div>
		<strong>试卷名：</strong>
		<input class="easyui-textbox" type="text" id="paperName"/>
		<strong>状态：</strong>
		<select name="browser" style="width:200px;height: 24px;border-radius:5px" id="isPass">
		<option value='0'>全部</option>
		<option value="1">通过</option>
		<option value="2">未通过</option>
		<option value="3">未提交或超时</option>
	    </select>
		<a href="javascript:void(0)" onclick="examRecord.toolbar.search();" class="easyui-linkbutton" data-options="
		iconCls:'icon-search',
		plain:true">
			查询
		</a>
	</div>
</div>
<script>	
	var examRecord = {
		init : function() {
			examRecord.examRecordGrid = $('#examRecordGrid');
			examRecord.isPass = $('#isPass');
			examRecord.paperName = $('#paperName');
			examRecord.examRecordGrid.datagrid({
			    url: '<%=request.getContextPath()%>/StuServlet?command=listExamInfo',
			    fitColumns: true,
			    striped: true,
			    rownumbers: true,
			    pagination: true,
			    pageSize: 10,
			    pageList: [10, 20, 30, 40, 50],
			    pageNumber: 1,
			    toolbar: '#examRecordToolbar',
			    columns:[[
					{field:'id', width:100, checkbox: true},
					{field:'pagename', title:'试卷名称', width:100, align:'center'},
					{field:'start_time', title:'开始时间', width:100, align:'center'},
					{field:'submit_time', title:'提交时间', width:100, align:'center'},
					{field:'total_point', title:'总分数', width:100, align:'center'},
					{field:'get_point', title:'得分数', width:100, align:'center'},
					{field:'is_pass', title:'是否通过', width:100, align:'center'}
			    ]],
				onDblClickRow: function(rowIndex, rowData) {
					examRecord.toolbar.showUpdateDialog(rowData.id);
				}
			});
		},
		toolbar: {
			redo: function() {
				examRecord.examRecordGrid.datagrid('unselectAll');
			},
			search:function(){
				examRecord.examRecordGrid.datagrid('load',{
					paperName:examRecord.paperName.val(),
					isPass:examRecord.isPass.val(),
					
				});
			}
		}
	};
	
	$(function(){
		 examRecord.init();
	});
</script>